package com.winsdom.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 操作日志表
 * </p>
 *
 * @author 
 * @since 2025-05-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_operation_log")
public class SysOperationLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 日志主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 操作执行时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime operationTime;

    /**
     * 操作人ID
     */
    private Integer userId;

    /**
     * 操作来源IP地址
     */
    @JsonIgnore
    private byte[] ipAddress;

    @TableField(exist = false)
    private String ipAddressStr;
    /**
     * 操作的功能模块
     */
    private String operationFunction;

    /**
     * 操作详细描述
     */
    private String operationDescription;

    /**
     * 逻辑删除标志，0-未删除，1-已删除
     */
    private Integer isDeleted;

    /**
     * 操作人姓名（非数据库字段）
     */
    @TableField(exist = false)
    private String userName;
}
